// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import * as _ from 'lodash'
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import iView from 'iview'
import ElementUI from 'element-ui'
import i18n from '@/i18n'
import config from '@/config'
import importDirective from '@/directive'
import { directive as clickOutside } from 'v-click-outside-x'
import installPlugin from '@/plugin'
import downloadMixin from '@/mixins/downloadExcel'
import dataV from '@jiaminghi/data-view'
// 引入echart
import echarts from 'echarts'
// 按需引入vue-awesome图标
import Icon from 'vue-awesome/components/Icon'
import 'vue-awesome/icons/chart-bar.js'
import 'vue-awesome/icons/chart-area.js'
import 'vue-awesome/icons/chart-pie.js'
import 'vue-awesome/icons/chart-line.js'
import 'vue-awesome/icons/align-left.js'

import '@/index.less'
import '@/assets/css/common.stylus'
import '@/assets/icons/iconfont.css'
import 'element-ui/lib/theme-chalk/index.css'

// 实际打包时应该不引入mock
/* eslint-disable */
// if (process.env.NODE_ENV !== 'production') require('@/mock')
// require('@/mock')

Vue.use(dataV);

// 全局注册图标
Vue.component('icon', Icon);

// 适配flex
import '@/libs/flexible.js';

// 引入全局css
import '@/assets/scss/style.scss';


Vue.use(iView, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(ElementUI)
/**
 * @description 注册admin内置插件
 */
installPlugin(Vue)

Vue.prototype.$echarts = echarts

/**
 * @description 生产环境关掉提示
 */
Vue.config.productionTip = false
/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config
Vue.prototype.$Message.config({
  duration: 3
})
// Vue.prototype.$Notice.config({
//   duration: 3
// })
/**
 * 注册指令
 */
importDirective(Vue)
Vue.directive('clickOutside', clickOutside)

Vue.mixin({
  ...downloadMixin
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  store,
  mixins: [downloadMixin],
  render: h => h(App)
})
